package client.comm.baoding.adapter

import android.content.Context
import android.view.ViewGroup
import androidx.databinding.DataBindingUtil
import androidx.databinding.ViewDataBinding
import androidx.recyclerview.widget.RecyclerView
import client.comm.commlib.base.BaseLoadmoreAdapter
import client.comm.commlib.base.BindingViewHoder
import client.comm.baoding.R
import client.comm.baoding.api.bean.BuyCartRet
import client.comm.baoding.api.bean.HmjlRet
import client.comm.baoding.databinding.LayoutHmjlitemBinding
import client.comm.baoding.databinding.LayoutJifenitemBinding
import client.comm.baoding.databinding.LayoutPendreleaseBalanceItemBinding
import client.comm.commlib.base.SimpleTextWatcher
import com.bumptech.glide.RequestManager

class PendReleaseBalanceAdapter : BaseLoadmoreAdapter<HmjlRet.Coin> {

    val manager: RequestManager

    constructor(context: Context, manager: RequestManager) : super(context) {
        this.manager = manager
    }

    override fun createVh(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {

        return BindingViewHoder(
            DataBindingUtil.inflate(
                layoutInflater,
                R.layout.layout_pendrelease_balance_item,
                parent,
                false
            )
        )
    }

    override fun bindVh(holder: RecyclerView.ViewHolder, position: Int) {
        val bindingViewHolder = holder as BindingViewHoder<ViewDataBinding>
        val binding = bindingViewHolder.binding as LayoutPendreleaseBalanceItemBinding
        binding.event = this
        val bean = getItem(position)

//        when (bean.status) {
//            0 -> {
//                binding.status = "释放中"
//            }
//            1 -> {
//                binding.status = "已完成"
//            }
//        }
//        binding.bean = bean
    }


    var releaseRecord: (() -> Unit)? = null

    /**
     *
     */
    fun releaseRecordClick() {
        releaseRecord?.invoke()
    }
}